package cn.uce.common.log.biz.impl;

import javax.annotation.Resource;

import cn.uce.base.page.Pagination;
import cn.uce.common.log.biz.IOperationLogBiz;
import cn.uce.common.log.entity.OperationLog;
import cn.uce.common.log.service.OperationLogService;
import cn.uce.common.log.vo.OperationLogVo;
import org.springframework.stereotype.Service;

import cn.uce.base.page.Page;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Description: BIZ实现类
 * @author UCE-CodeGenerator
 * @date 2020年05月04日 上午11:44:53
 */
@Service("operationLogBiz")
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS,rollbackFor = Exception.class)
public class OperationLogBiz implements IOperationLogBiz {
	
	/**
	 * 注入Service
	 */
	@Resource
	private OperationLogService operationLogService;
	
	/**
	 * @Description: 新增
	 * @param operationLog
	 * @return 受影响行数
	 * @author UCE-CodeGenerator
	 * @date 2020年05月04日 上午11:44:53
	 */
	@Override
	@Transactional
	public int addOperationLog(OperationLog operationLog) {
		return operationLogService.addOperationLog(operationLog);
	}
	
	/**
	 * @Description: 修改
	 * @param operationLog 
	 * @return 受影响行数
	 * @author UCE-CodeGenerator
	 * @date 2020年05月04日 上午11:44:53
	 */
	@Override
	@Transactional
	public int updateOperationLog(OperationLog operationLog) {
		return operationLogService.updateById(operationLog);
	}
	
	/**
	 * @Description: 删除
	 * @param id 主键
	 * @return 受影响行数
	 * @author UCE-CodeGenerator
	 * @date 2020年05月04日 上午11:44:53
	 */
	@Override
	@Transactional
	public int deleteOperationLog(Long id) {
		return operationLogService.deleteById(id);
	}
	
	/**
	 * @Description: 根据ID查询
	 * @param id 主键
	 * @return 
	 * @author UCE-CodeGenerator
	 * @date 2020年05月04日 上午11:44:53
	 */
	@Override
	public OperationLog findById(Long id) {
		return operationLogService.findById(id);
	}
	
	/**
	 * @Description: 分页查询
	 * @param operationLogVo 
	 * @param page 分页参数
	 * @return 
	 * @author UCE-CodeGenerator
	 * @date 2020年05月04日 上午11:44:53
	 */
	public Pagination<OperationLog> findByPagination(OperationLogVo operationLogVo, Page page) {
		Pagination<OperationLog> pagination = operationLogService.findByPagination(operationLogVo, page);
		return pagination;
	}

}